package cn.lanqiao.facelogin.controller;

import cn.lanqiao.facelogin.domain.ResParameter;
import cn.lanqiao.facelogin.domain.Result;
import cn.lanqiao.facelogin.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/sql")
@Api(tags = "sql业务")
@RestController
public class SqlController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/queryFaceToken")
    @ApiOperation("通过uuid查询faceToken")
    @ApiImplicitParam(name = "uuid", value = "UUID", required = true)
    public Result queryFaceToken(String uuid) {
        return loginService.queryFaceToken(uuid);
    }



    @PostMapping("/test")
    public Result test() {
        new Result(true, ResParameter.LOGIN_SUCCESS_CODE, ResParameter.FACE_DETECT_SUCCESS, null);
        return new Result(true, ResParameter.LOGIN_SUCCESS_CODE, ResParameter.FACE_DETECT_SUCCESS, null);
    }
}
